<template>
  <svg :class="['svg-icon', className]" aria-hidden="true" v-on="$listeners">
    <use :xlink:href="iconName" />
  </svg>
</template>
  
  <script>
export default {
  name: "SvgIcon",
  props: {
    iconClass: {
      type: String,
      required: true,
    },
    className: {
      type: String,
      default: "",
    },
  },
  computed: {
    iconName() {
      return `#icon-${this.iconClass}`;
    },
  },
};
</script>

  <!-- svg图标样式,可自行进行修改 -->
<style scoped>
.svg-icon {
  fill: currentColor;
}
</style>

